﻿using Architecture.Domian.Common;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Architecture.Domain.TraceabilityManage
{
    /// <summary>
    /// 公司表
    /// </summary>
    [Table("Corporation")]
    public class Corporation : AuditInfo
    {
        /// <summary>
        /// 公司Id
        /// </summary>
        [Key]
        public int CId { get; set; }

        /// <summary>
        /// 生产批次
        /// </summary>
        [StringLength(50)]
        public string? ProductionLot { get; set; }

        /// <summary>
        /// 公司名称
        /// </summary>
        [StringLength(50)]
        public string? CompanyName { get; set; }

        /// <summary>
        /// 省
        /// </summary>
        public long Province { get; set; }

        /// <summary>
        /// 市
        /// </summary>
        public long City { get; set; }

        /// <summary>
        /// 县
        /// </summary>
        public long County { get; set; }

        /// <summary>
        /// 成立时间
        /// </summary>
        public DateTime? EstablishmentTime { get; set; }

        /// <summary>
        /// 成立时间
        /// </summary>
        [NotMapped]
        public string? EstablishmentDateTime
        {
            get { return EstablishmentTime == null ? null : Convert.ToDateTime(EstablishmentTime).ToString("yyyy年MM月dd日"); }
        }

        /// <summary>
        /// 公司简介
        /// </summary>
        [StringLength(200)]
        public string? CompanyProfile { get; set; }

        /// <summary>
        /// 公司图片
        /// </summary>
        [StringLength(1000)]
        public string? CompanyPicture { get; set; }

        /// <summary>
        /// 养殖负责人
        /// </summary>
        [StringLength(50)]
        public string? HeadOfBreeding { get; set; }

        /// <summary>
        /// 养殖数量
        /// </summary>
        public int BreedingQuantity { get; set; }

        /// <summary>
        /// 生产许可证
        /// </summary>
        public string? ProductionLicense { get; set; }
    }
}
